package com.wunong.smart.commission.application.request.support;

import com.wunong.smart.commission.application.request.BaseCommissionRequest;
import com.wunong.smart.commission.client.param.CreateCommissionParam;
import com.wunong.smart.domain.platform.common.BizSource;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 创建代办
 *
 * @author create by zealot.zt
 */
@Getter
@Setter
@ToString(callSuper = true)
public class CreateCommissionRequest extends BaseCommissionRequest {

    /**
     * 用户角色
     */
    private Integer userRole;

    /**
     * 业务信息
     */
    private BizSource source;

    /**
     * 代办类型
     */
    private String commissionType;

    /**
     * 代办内容
     */
    private String content;

    public static CreateCommissionRequest of(CreateCommissionParam param) {
        CreateCommissionRequest request = new CreateCommissionRequest();
        request.initBasic(param);

        request.setUserId(param.getUserId());
        request.setUserRole(param.getUserRole());
        request.setSource(BizSource.of(param.getBizId(), param.getBizType()));
        request.setCommissionType(param.getCommissionType());
        request.setContent(param.getContent());

        return request;
    }

}
